Adaptive multi-hypothesis context-adaptive binary arithmetic coding (MCABAC)

ABSTRACT

A method comprises obtaining a first weight for a first probability associated with a first probability update window; obtaining a second weight for a second probability associated with a second probability update window, wherein the first weight and the second weight are unequal; and coding, using the first weight and the second weight, a portion of a video.

CROSS-REFERENCE TO RELATED APPLICATIONS

This is a continuation of Int'l Patent App. No. PCT/US2019/013037 filed on Jan. 10, 2019 by Futurewei Technologies, Inc. and titled “Adaptive Multi-Hypothesis Context-Adaptive Binary Arithmetic Coding (MCABAC),” which claims priority to U.S. Prov. Patent App. No. 62/617,049 filed on Jan. 12, 2018 by Futurewei Technologies, Inc. and titled “Adaptive Multi-Hypothesis Context-Adaptive Binary Arithmetic Coding (MCABAC),” both of which are incorporated by reference.

TECHNICAL FIELD

The disclosed embodiments relate to video coding in general and MCABAC in particular.

BACKGROUND

Videos use a relatively large amount of data, so communication of videos uses a relatively large amount of bandwidth. However, many networks operate at or near their bandwidth capacities. In addition, customers demand high video quality, which requires using even more data. There is therefore a desire to both reduce the amount of data videos use and improve video quality. One solution is to compress videos during an encoding process and decompress the videos during a decoding process.

SUMMARY

A first aspect relates to a method comprising obtaining a first weight for a first probability associated with a first probability update window; obtaining a second weight for a second probability associated with a second probability update window, wherein the first weight and the second weight are unequal; and coding, using the first weight and the second weight, a portion of a video. The method provides for the ability to model bin strings with more emphasis on P₀ ^(new) or on P₁ ^(new).

In a first implementation form of the method according to the first aspect as such, an overall probability is based on the first weight, the first probability, the second weight, and the second probability.

In a second implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the overall probability is equal to 1.

In a third implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the first weight is α₀, the first probability is P₀ ^(new), the second weight is α₁, and the second probability is P₁ ^(new) and wherein P=α₀P₀ ^(new)+α₁P₁ ^(new).

In a fourth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the first probability update window is shorter than the second probability update window and used for quickly-changing data, and wherein the second probability update window is used for slowly-changing data.

In a fifth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, at least one of the first weight or the second weight is predefined.

In a sixth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, a sum of the first weight and the second weight is 1.

In a seventh implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the coding is encoding.

In an eighth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the method further comprises signaling at least one of the first weight or the second weight in a bitstream.

In a ninth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the signaling is based on an equal distribution.

In a tenth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the signaling is based on an unequal distribution.

In an eleventh implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the signaling is in a sequence parameter set.

In a twelfth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, wherein the signaling is in a picture parameter set.

In a thirteenth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the method further comprises deriving at least one of the first weight and the second weight.

In a fourteenth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the deriving is based on a first counter for the first probability, a second counter for the second probability, and a comparison of the first counter and the second counter.

In a fifteenth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the coding is decoding.

In a sixteenth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the method further comprises receiving a code indicating at least one of the first weight or the second weight in a bitstream.

In a seventeenth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the code is based on an equal distribution.

In an eighteenth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the code is based on an unequal distribution.

In a nineteenth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the code is in a sequence parameter set.

In a twentieth implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the code is in a picture parameter set.

In a twenty-first implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the method further comprises deriving at least one of the first weight and the second weight.

In a twenty-second implementation form of the method according to the first aspect as such or any preceding implementation form of the first aspect, the deriving is based on a first counter for the first probability, a second counter for the second probability, and a comparison of the first counter and the second counter.

A second aspect relates to an apparatus comprising a memory; and a processor coupled to the memory and configured to perform any of the first aspect as such or any preceding implementation form of the first aspect.

A third aspect relates to a computer program product comprising computer-executable instructions stored on a non-transitory medium that when executed by a processor cause an apparatus to perform any of the first aspect as such or any preceding implementation form of the first aspect.

Embodiments can be implemented in hardware, software, or in any combination of hardware and software.

Any of the above embodiments may be combined with any of the other above embodiments to create a new embodiment. These and other features will be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings and claims.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of this disclosure, reference is now made to the following brief description, taken in connection with the accompanying drawings and detailed description, wherein like reference numerals represent like parts.

FIG. 1 is a schematic diagram of a coding system.

FIG. 2 is a block diagram of a simplified CABAC encoder.

FIG. 3A is SPS syntax according to an embodiment of the disclosure

FIG. 3B is PPS syntax according to an embodiment of the disclosure.

FIG. 4A is SPS syntax according to another embodiment of the disclosure

FIG. 4B is PPS syntax according to another embodiment of the disclosure.

FIG. 5 is a flowchart illustrating a method of deriving a weight according to an embodiment of the disclosure.

FIG. 6 is a flowchart illustrating a method of coding a portion of a video according to an embodiment of the disclosure.

FIG. 7 is a schematic diagram of an apparatus according to an embodiment of the disclosure.

DETAILED DESCRIPTION

It should be understood at the outset that, although an illustrative implementation of one or more embodiments are provided below, the disclosed systems and/or methods may be implemented using any number of techniques, whether currently known or in existence. The disclosure should in no way be limited to the illustrative implementations, drawings, and techniques illustrated below, including the exemplary designs and implementations illustrated and described herein, but may be modified within the scope of the appended claims along with their full scope of equivalents.

The following abbreviations apply:

ASIC: application-specific integrated circuit

CABAC: context-adaptive binary arithmetic coding

CPU: central processing unit

CU: coding unit

DSP: digital signal processor

EO: electrical-to-optical

FPGA: field-programmable gate array

GOP: group of pictures

LPS: least probable symbol

MCABAC: multi-hypothesis CABAC

MVD: motion vector difference

NAL: network abstraction layer

OE: optical-to-electrical

PPS: picture parameter set

RAM: random-access memory

RF: radio frequency

ROM: read-only memory

RX: receiver unit

SPS: sequence parameter set

SRAM: static RAM

TCAM: ternary content-addressable memory

TX: transmitter unit.

FIG. 1 is a schematic diagram of a coding system 100. The coding system 100 comprises a source device 110, a medium 150, and a destination device 160. The source device 110 and the destination device 160 are mobile phones, tablet computers, desktop computers, notebook computers, or other devices. The medium 150 is a local network, a radio network, the Internet, or another communications medium.

The source device 110 comprises a video generator 120, an encoder 130, and an output interface 140. The video generator 120 is a camera or another device that generates videos. The encoder 130 may be referred to as a codec. The encoder 130 encodes the videos and other data into bitstreams according to a set of rules. The output interface 140 is an antenna or another component that transmits the bitstreams to the destination device 160. Alternatively, the video generator 120, the encoder 130, and the output interface 140 are in a combination of devices.

The destination device 160 comprises an input interface 170, a decoder 180, and a display 190. The input interface 170 is an antenna or another component that receives the bitstreams from the source device 110. The decoder 180 may also be referred to as a codec. The decoder 180 decodes the videos and other data from the bitstreams according to the set of rules. Together, encoding and decoding are referred to as coding. The display 190 displays the videos for a user to view. Alternatively, the input interface 170, the decoder 180, and the display 190 are in a combination of devices.

The encoder 130 may encode videos using lossless coding to obtain encoded videos. Lossless coding is coding that allows the decoder 180 to then perfectly decode the encoded videos to obtain the original videos. One type of lossless coding is entropy coding, which represents frequently-occurring patterns with relatively fewer bits and rarely-occurring patterns with relatively more bits. CABAC is a type of entropy coding based on arithmetic coding.

FIG. 2 is a block diagram of a simplified CABAC encoder 200. The simplified CABAC encoder 200 implements the encoder 130. The simplified CABAC encoder 200 comprises a binarizer 210, a context modeler 220, and a coding engine 230.

The binarizer 210 receives symbols of syntax elements, applies a binarization scheme to the symbols to obtain bin strings, and provides the bin strings to the context modeler 220. The syntax elements describe how the decoder 180 can reconstruct videos. The syntax elements include, for instance, MVDs and related data.

The context modeler 220 receives the bin strings, compares bits in probability update windows of the bin strings to context models, and updates the context models based on the comparison. A probability update window, or simply a window, is a specified number of bits in a bin string. Each syntax element may have its own context model. For the comparison, the context modeler 220 compares what an old probability, P^(old), predicts a predicted value of a bit should be to what the actual value of the bit is. The context modeler 220 updates P^(old) to a new probability, P^(new) after the comparison. If the predicted value and the actual value are different, then P^(old) and P^(new) are different; if the predicted value and the actual value are the same, then P^(old) and P^(new) are also the same. Together, P^(old), P^(new), and the rules for how to update P^(old) to P^(new) make up a context model. The context modeler 220 provides the bin strings and a final P^(new) to the coding engine 230.

The coding engine 230 receives the bin strings and P^(new) from the context modeler 220 and encodes the bits in the bin strings according to P^(new) to obtain encoded bits. Finally, the coding engine 230 provides the encoded bits to the output interface 140 as a bitstream for transmission to the destination device 160 over the medium 150. The decoder 180 then decodes the bitstream in an opposite manner.

MCABAC uses two probability update windows instead of one. Specifically, W₀ is relatively shorter and used for quickly-changing data, and W₁ is relatively longer and used for slowly-changing data. W₀ is shorter than W₁. W₀ and W₁ are associated with their own probabilities, P₀ and P₁, respectively. P₀ and P₁ are represented as follows:

$\begin{matrix} {P_{0}^{new} = \left\{ \begin{matrix} {P_{0}^{old} + {\left\lbrack {\left( {2^{k} - P_{0}^{old}} \right){> >}M_{i}} \right\rbrack\mspace{14mu}{if}\mspace{14mu}{input}\mspace{14mu}{is}\mspace{20mu} 1}} \\ {P_{0}^{old} - {\left( {P_{0}^{old}{> >}M_{i}} \right)\mspace{14mu}{if}\mspace{14mu}{input}\mspace{14mu}{is}\mspace{14mu} 0}} \end{matrix} \right.} & (1) \\ {P_{1}^{new} = \left\{ {\begin{matrix} {P_{1}^{old} + {\left\lbrack {\left( {2^{k} - P_{1}^{old}} \right){> >}8} \right\rbrack\mspace{14mu}{if}\mspace{14mu}{input}\mspace{14mu}{is}\mspace{14mu} 1}} \\ {P_{1}^{old} - {\left( {P_{1}^{old}{> >}8} \right)\mspace{14mu}{if}\mspace{14mu}{input}\mspace{14mu}{is}\mspace{14mu} 0}} \end{matrix}.} \right.} & (2) \end{matrix}$ k is an encoder precision in bits; >> is a symbol indicating a multiplication of 2 to the power of a succeeding amount, in this case 2^(M) ^(i) or 2⁸; M_(i) is a length of W₀; and a length of W₁ is 8. M_(i) is variable, so the encoder 130 encodes it in the bitstream. An overall probability, P, is equal to 1 and defined as follows:

$\begin{matrix} {{P = \frac{P_{0}^{new} + P_{1}^{new}}{2}}{P = {{0.5\; P_{0}^{new}} + {0.5\;{P_{1}^{new}.}}}}} & (3) \end{matrix}$ P is a normalized value. In equation (3), both P₀ ^(new) and P₁ ^(new) have a weight of 0.5. However, it may be desirable to model bin strings with more emphasis on P₀ ^(new) or on P₁ ^(new). Thus, it may be desirable to assign different weights, not necessarily 0.5, to P₀ ^(new) and P₁ ^(new). In addition, it may be desirable to adaptively change those weights.

Disclosed herein are embodiments for adaptive MCABAC. The embodiments provide for setting different lengths of W₀ and W₁; setting unequal weights for P₀ ^(new) and P₁ ^(new); and setting those weights differently for each context model, the same for sets of context models, or the same for all context models. The weights are predefined at an encoder and at a decoder, the encoder signals the weights, or both the encoder and the decoder derive the weights. While deriving the weights, the encoder and the decoder may adapt P₀ ^(new) and P₁ ^(new). The embodiments provide for the ability to model bin strings with more emphasis on P₀ ^(new) or on P₁ ^(new).

First, instead of the encoder 130 signaling M_(i) for W₀ and instead of setting a length of W₁ to 8, a length M_(s) for short W₀ and a length M_(l) for long W₁ are set. Thus, equations (1) and (2) become the following:

$\begin{matrix} {P_{0}^{new} = \left\{ \begin{matrix} {P_{0}^{old} + {\left\lbrack {\left( {2^{k} - P_{0}^{old}} \right){> >}M_{s}} \right\rbrack\mspace{14mu}{if}\mspace{14mu}{input}\mspace{14mu}{is}\mspace{20mu} 1}} \\ {P_{0}^{old} - {\left( {P_{0}^{old}{> >}M_{s}} \right)\mspace{14mu}{if}\mspace{14mu}{input}\mspace{14mu}{is}\mspace{14mu} 0}} \end{matrix} \right.} & (4) \\ {P_{1}^{new} = \left\{ {\begin{matrix} {P_{1}^{old} + {\left\lbrack {\left( {2^{k} - P_{1}^{old}} \right){> >}M_{l}} \right\rbrack\mspace{14mu}{if}\mspace{14mu}{input}\mspace{14mu}{is}\mspace{20mu} 1}} \\ {P_{1}^{old} - {\left( {P_{1}^{old}{> >}M_{l}} \right)\mspace{14mu}{if}\mspace{14mu}{input}\mspace{14mu}{is}\mspace{14mu} 0}} \end{matrix}.} \right.} & (5) \end{matrix}$ For instance, M_(s)=4, and M_(i)=8.

Second, instead of setting an equal weight of 0.5 for both P₀ ^(new) and P₁ ^(new), unequal weights for P₀ ^(new) and P₁ ^(new) are set. Thus, equation (3) becomes the following: P=α ₀ P ₀ ^(new)+α₁ P ₁ ^(new).  (6) α₀ is a weight for P₀ ^(new), α₁ is a weight for P₁ ^(new), and α₀≠α₁. α₀ and α₁ are normalized values. When α₀+α₁=1, equation (6) becomes the following: P=α ₀ P ₀ ^(new)+(1−α₀)P ₁ ^(new).  (7) Alternatively, instead of equation (6), equation (3) becomes the following: P=[α₀ P ₀ ^(new)+(2^(N)−α₀)P ₁ ^(new)]>>N.  (8) N is a predefined integer. For instance, N=3. In this context, predefined may mean that N is set before the encoder 130 encodes, or the decoder 180 decodes, a bitstream based on N. When α₀>α₁, more emphasis is on P₀ ^(new) instead of on P₁ ^(new). Similarly, when α₁>α₀, more emphasis is on P₁ ^(new) instead of on P₀ ^(new).

Third, α₀ is different for each context model, and α₁ is different for each context model. Alternatively, α₀ is the same for a set of context models, and α₁ is the same for a set of context models. Alternatively, α₀ is the same for all context models, and α₁ is the same for all context models. Alternatively, one technique is used for α₀ and another technique is used for α₁.

Fourth, α₀ and α₁ are determined using one of the following three approaches. By determining α₀, α₁ may also be determined when α₀+α₁=1. Similarly, by determining α₁, α₀ may also be determined.

In a first approach for determining α₀ and α₁, α₀ and α₁ are predefined. In this context, predefined may mean that α₀ and α₁ are set before the encoder 130 encodes, and the decoder 180 decodes, a bitstream based on α₀ and α₁. For instance, α₀ and α₁ are set in a codec.

In a second approach for determining α₀ and α₁, the encoder 130 signals α₀, α₁, or both α₀ and α₁ in a bitstream. Though signaling of α₀ is described, the encoder 130 may similarly encode α₁ or both α₀ and α₁. The encoder 130 signals α₀ using j bits, where j is an integer. For instance, when j=3, the encoder 130 signals α₀ as follows:

TABLE 1 Values for α₀. Code 000 001 010 011 100 101 110 111 Equal Distribution 0 ⅛ ¼ ⅜ ½ ⅝ ¾ ⅞ Unequal Distribution 0 1/32 1/16 ¼ ½ ⅝ ¾ ⅞ Table 1 comprises both an equal distribution and an unequal distribution. The equal distribution comprises equally-spaced values for α₀, and the unequal distribution comprises unequally-spaced values for α₀. The encoder 130 and the decoder 180 may store Table 1, or the equal distribution portion or the unequal portion of Table 1, as a lookup table. As an example, if the encoder 130 signals 011 for α₀, then the decoder 180 looks up 011 in its lookup table and determines that α₀ is 3/8. The decoder 180 then subtracts 3/8 from 1 to determine that α₁ is 5/8. J may be variable. The encoder signals α₀, α₁, or both α₀ and α₁ in an SPS, a PPS, a slice header, or another high-level NAL unit.

FIG. 3A is SPS syntax 310 according to an embodiment of the disclosure. The SPS syntax 310 comprises a CABAC weights present flag, cabac_weights_present_flag, which indicates that a value of α₀ should be initialized based on a predefined relationship. FIG. 3B is PPS syntax 320 according to an embodiment of the disclosure. The PPS syntax 320 comprises a CABAC weights present flag, cabac_weights_present_flag, which indicates that a value of α₀ should be initialized based on a predefined relationship. Though the SPS syntax 310 and the PPS syntax 320 comprise cabac_weights_present_flag in the locations shown, the SPS syntax 310 and the PPS syntax 320 may comprise cabac_weights_present_flag in another suitable location. The predefined relationship may be a table such as Table 1 and may indicate a different value for each context model, a different value for each set of context models, or the same value for all context models. In this context, predefined may mean that α₀ is set before the encoder 130 encodes, or the decoder 180 decodes, a bitstream based on α₀. For instance, α₀ may be hardcoded.

FIG. 4A is SPS syntax 410 according to another embodiment of the disclosure. The SPS syntax 410 comprises a CABAC weights present flag, cabac_weights_present_flag, which indicates that a value of α₀ should be initialized based on a predefined relationship. FIG. 4B is PPS syntax 420 according to an embodiment of the disclosure. The PPS syntax 420 comprises a CABAC weights present flag, cabac_weights_present_flag, which indicates that a value of α₀ should be initialized based on a predefined relationship. Though the SPS syntax 410 and the PPS syntax 420 comprise cabac_weights_present_flag in the locations shown, the SPS syntax 410 and the PPS syntax 420 may comprise cabac_weights_present_flag in another suitable location. The predefined relationship may be a table such as Table 1 and may indicate a different value for each context model, a different value for each set of context models, or the same value for all context models. In this context, predefined may mean that α₀ is set before the encoder 130 encodes, or the decoder 180 decodes, a bitstream based on α₀. For instance, α₀ may be hardcoded.

In a third approach for determining α₀ and α₁, both the encoder 130 and the decoder 180 derive α₀. The encoder 130 and the decoder 180 may do so using the same method. Though derivation of α₀ is described, the encoder 130 and the decoder 180 may similarly encode α₁ or both α₀ and α₁.

FIG. 5 is a flowchart illustrating a method 500 of deriving a weight according to an embodiment of the disclosure. The encoder 130 or the decoder 180 performs the method 500. At step 505, the encoder 130 or the decoder 180 initializes α₀. For instance, the encoder 130 or the decoder 180 initializes α₀ at 0.5.

At decision diamond 510, the encoder 130 or the decoder 180 determines whether there is an LPS switch for P₀ ^(new). For instance, if P₀ ^(new) predicts a predicted value of a bit should be 0 so that an LPS for the bit is 1, meaning the predicted value is not 1, and if the actual value of the bit is 0, then the predicted value is correct, there is no LPS switch, and the method 500 proceeds to decision diamond 520. However, if P₀ ^(new) predicts a predicted value of a bit should be 0 so that an LPS for the bit is 1, meaning the predicted value is not 1, and if the actual value of the bit is 1, then the predicted value is incorrect, there is an LPS switch, and the method 500 proceeds to step 515. At step 515, the encoder 130 or the decoder 180 adds to C₀, which is a counter for α₀ and its corresponding probability P₀ ^(new).

At decision diamond 520, the encoder 130 or the decoder 180 determines whether there is an LPS switch for P₁ ^(new). For instance, if P₁ ^(new) predicts a predicted value of a bit should be 0 so that an LPS for the bit is 1, meaning the predicted value is not 1, and if the actual value of the bit is 0, then the predicted value is correct, there is no LPS switch, and the method 500 proceeds to decision diamond 530. However, if P₀ ^(new) predicts a predicted value of a bit should be 0 so that an LPS for the bit is 1, meaning the predicted value is not 1, and if the actual value of the bit is 1, then the predicted value is incorrect, there is an LPS switch, and the method 500 proceeds to step 525. At step 525, the encoder 130 or the decoder 180 adds to C₁, which is a counter for α₁ and its corresponding probability P₁ ^(new).

At decision diamond 530, the encoder 130 or the decoder 180 determines whether C₀=C₁. If not, then the method 500 proceeds to decision diamond 540. If so, then the method proceeds to step 535. At step 535, the encoder 130 or the decoder 180 leaves α₀ unchanged and returns to decision diamond 510 to analyze a subsequent bit.

At decision diamond 540, the encoder 130 or the decoder 180 determines whether C₀<C₁. If not, then the method 500 proceeds to step 550. If so, then the method 500 proceeds to step 545. At step 545, the encoder 130 or the decoder 180 decreases α₀ and returns to decision diamond 510 to analyze a subsequent bit. At step 550, the encoder 130 or the decoder 180 increases α₀ and returns to decision diamond 510 to analyze a subsequent bit. The decrease at step 545 and the increase at step 550 are by a predefined increment, for instance 0.1. In this context, predefined means set before the encoder 130 or the decoder 180 performs the method 500.

The encoder 130 or the decoder 180 repeats the method 500 for each bit of a context entity such as a CU, a tile, a frame, or a GOP. By increasing or decreasing α₀, α₁, or both α₀ and α₁ while performing the method 600, the encoder 130 or the decoder 180 adapts P₀ ^(new) and P₁ ^(new).

Alternatively, instead of one of the three approaches above, the encoder 130 or the decoder 180 determines α₀, α₁, or both α₀ and α₁ with any suitable precision using a shallow neural network. The precision may be variable. Alternatively, the encoder 130 signals α₀, α₁, or both α₀ and α₁ using an on/off flag combined with any of the three approaches above. Alternatively, the encoder 130 or the decoder 180 determines statistical behavior and selects from a lookup table α₀, α₁, or both α₀ and α₁ corresponding to the statistical behavior.

FIG. 6 is a flowchart illustrating a method 600 of coding a portion of a video according to an embodiment of the disclosure. The encoder 130 or the decoder 180 performs the method 600. At step 610, a first weight for a first probability associated with a first probability update window is obtained. For instance, the encoder 130 or the decoder 180 obtains α₀, α₀ is for P₀ ^(new), and P₀ ^(new) is associated with K. At step 620, a second weight for a second probability associated with a second probability update window is obtained. For instance, the encoder 130 or the decoder 180 obtains α₁, α₁ is for P₁ ^(new), and P₁ ^(new) is associated with W₁. The first weight and the second weight are unequal. Finally, at step 630, a portion of a video is coded using the first weight and the second weight. For instance, the encoder 130 encodes, or the decoder 180 decodes, a bin string using equations (4)-(6).

In the method 600, an overall probability may be based on the first weight, the first probability, the second weight, and the second probability. For instance, the overall probability is as expressed in equation (6), (7), or (8). The overall probability may be equal to 1. The first weight may be α₀, the first probability may be P₀ ^(new), the second weight may be α₁, and the second probability may be P₁ ^(new). Specifically, the overall probability may be as expressed in equation (6). The first probability update window may be shorter than the second probability update window and used for quickly-changing data, and the second probability update window may be used for slowly-changing data. For instance, the first probability update window is W₀ and the second probability update window is W₁. At least one of the first weight or the second weight is predefined. A sum of the first weight and the second weight may be equal to 1.

When the coding in the method 600 is encoding, the method 600 may further comprise signaling at least one of the first weight or the second weight in a bitstream. The signaling may be based on an equal distribution. The signaling may be based on an unequal distribution. For instance, the signaling is based on either the equal distribution or the unequal distribution in Table 1. The signaling may be in a sequence parameter set. The signaling may be in a picture parameter set. The weights may be in a separate table. The method 600 may further comprise deriving at least one of the first weight and the second weight. For instance, the method 600 may further comprise the method 500. The deriving may be based on a first counter for the first probability, a second counter for the second probability, and a comparison of the first counter and the second counter. For instance, the first counter is C₀, the second counter is C₁, and the comparison is the decision diamond 530, the decision diamond 540, or both the decision diamond 530 and the decision diamond 540.

When the coding in the method 600 is decoding, the method 600 may further comprise receiving a code indicating at least one of the first weight or the second weight in a bitstream. For instance, the code is one of the codes in Table 1. The code may be based on an equal distribution. The code may be based on an unequal distribution. For instance, the code is based on either the equal distribution or the unequal distribution in Table 1. The code may be in a sequence parameter set. The code may be in a picture parameter set. The method 600 may further comprise deriving at least one of the first weight and the second weight. For instance, the method 600 may further comprise the method 500. The deriving is based on a first counter for the first probability, a second counter for the second probability, and a comparison of the first counter and the second counter. For instance, the first counter is C₀, the second counter is C₁, and the comparison is the decision diamond 530, the decision diamond 540, or both the decision diamond 530 and the decision diamond 540.

An apparatus comprising a memory and a processor coupled to the memory may perform the method 500. A computer program product comprising computer-executable instructions stored on a non-transitory medium that when executed by a processor may cause an apparatus to perform the method 500.

FIG. 7 is a schematic diagram of an apparatus 700 according to an embodiment of the disclosure. The apparatus 700 may implement the disclosed embodiments. The apparatus 700 comprises ingress ports 710 and an RX 720 to receive data; a processor, logic unit, baseband unit, or CPU 730 to process the data; a TX 740 and egress ports 750 to transmit the data; and a memory 760 to store the data. The apparatus 700 may also comprise OE components, EO components, or RF components coupled to the ingress ports 710, the RX 720, the TX 740, and the egress ports 750 to provide ingress or egress of optical signals, electrical signals, or RF signals.

The processor 730 is any combination of hardware, middleware, firmware, or software. The processor 730 comprises any combination of one or more CPU chips, cores, FPGAs, ASICs, or DSPs. The processor 730 communicates with the ingress ports 710, the RX 720, the TX 740, the egress ports 750, and the memory 760. The processor 730 comprises an adaptive MCABAC component 770, which implements the disclosed embodiments. The inclusion of the adaptive MCABAC component 770 therefore provides a substantial improvement to the functionality of the apparatus 700 and effects a transformation of the apparatus 700 to a different state. Alternatively, the memory 760 stores the motion adaptive MCABAC component 770 as instructions, and the processor 730 executes those instructions.

The memory 760 comprises any combination of disks, tape drives, or solid-state drives. The apparatus 700 may use the memory 760 as an over-flow data storage device to store programs when the apparatus 700 selects those programs for execution and to store instructions and data that the apparatus 700 reads during execution of those programs. The memory 760 may be volatile or non-volatile and may be any combination of ROM, RAM, TCAM, or SRAM.

An apparatus comprises a memory element; and a processor element coupled to the memory element and configured to perform the following method: obtaining a first weight for a first probability associated with a first probability update window; obtaining a second weight for a second probability associated with a second probability update window, wherein the first weight and the second weight are unequal; and coding, using the first weight and the second weight, a portion of a video.

While several embodiments have been provided in the present disclosure, it may be understood that the disclosed systems and methods might be embodied in many other specific forms without departing from the spirit or scope of the present disclosure. The present examples are to be considered as illustrative and not restrictive, and the intention is not to be limited to the details given herein. For example, the various elements or components may be combined or integrated in another system or certain features may be omitted, or not implemented.

In addition, techniques, systems, subsystems, and methods described and illustrated in the various embodiments as discrete or separate may be combined or integrated with other systems, components, techniques, or methods without departing from the scope of the present disclosure. Other items shown or discussed as coupled may be directly coupled or may be indirectly coupled or communicating through some interface, device, or intermediate component whether electrically, mechanically, or otherwise. Other examples of changes, substitutions, and alterations are ascertainable by one skilled in the art and may be made without departing from the spirit and scope disclosed herein. 

What is claimed is:
 1. A method comprising: obtaining a first weight α₀ for a first probability P₀ ^(new) associated with a first probability update window W₀; obtaining a second weight α₁ for a second probability P₁ ^(new) associated with a second probability update window W₁, wherein α₀ and α₁ are non-binary and unequal, wherein P₀ ^(new) and P₁ ^(new) are based on a comparison of what an old probability predicts a predicted value of a bit should be to what an actual value of the bit is, and wherein W₀ and W₁ are specified numbers of bits in a bin string; and coding, using α₀, α₁, and multi-hypothesis context-adaptive binary arithmetic coding (MCABAC), a portion of a video.
 2. The method of claim 1, wherein an overall probability is based on α₀, P₀ ^(new), α₁ and P₁ ^(new).
 3. The method of claim 2, wherein P=α₀P₀ ^(new)+α₁P₁ ^(new), wherein P=1, and wherein the overall probability is P.
 4. The method of claim 1, wherein W₀ is shorter than W₁ and used for quickly-changing data, and wherein W₁ is used for slowly-changing data.
 5. The method of claim 1, wherein at least one of α₀ or α₁ is predefined.
 6. The method of claim 1, wherein a sum of α₀ and α₁ is
 1. 7. The method of claim 1, wherein the coding is encoding.
 8. The method of claim 7, further comprising signaling at least one of α₀ or α₁ in a bitstream.
 9. The method of claim 8, wherein the signaling is based on an equal distribution.
 10. The method of claim 8, wherein the signaling is based on an unequal distribution.
 11. The method of claim 8, wherein the signaling is in a sequence parameter set or a picture parameter set.
 12. The method of claim 7, further comprising deriving at least one of α₀ or α₁, wherein the deriving is based on a first counter for P₀ ^(new), a second counter P₁ ^(new), and a comparison of the first counter and the second counter.
 13. The method of claim 1, wherein the coding is decoding.
 14. The method of claim 13, further comprising receiving a code indicating at least one of α₀ or α₁ in a bitstream.
 15. The method of claim 14, wherein the code is based on an equal distribution.
 16. The method of claim 14, wherein the code is based on an unequal distribution.
 17. The method of claim 14, wherein the code is in a sequence parameter set or a picture parameter set.
 18. The method of claim 13, further comprising deriving at least one of α₀ or α₁, wherein the deriving is based on a first counter for P₀ ^(new), a second counter for P₁ ^(new), and a comparison of the first counter and the second counter.
 19. An apparatus comprising: a memory configured to store instructions; and a processor coupled to the memory and configured to: obtain a weight α₀ for a first probability P₀ ^(new) associated with a first probability update window W₀; obtain a second weight α₁ for a second probability P₁ ^(new) associated with a second probability update window W₁, wherein α₀ and α₁ are non-binary and are unequal, wherein P₀ ^(new) and P₁ ^(new) are based on a comparison of what an old probability predicts a predicted value of a bit should be to what an actual value of the bit is, and wherein W₀ and W₁ are specified numbers of bits in a bin string; and code, using α₀, α₁, and multi-hypothesis context-adaptive binary arithmetic coding (MCABAC), a portion of a video.
 20. A computer program product comprising instructions stored on a non-transitory medium and that, when executed by a processor, cause an apparatus to: obtain a first weight α₀ for a first probability P₀ ^(new) associated with a first probability update window W₀; obtain a second weight α₁ for a second probability P₁ ^(new) associated with a second probability update window W₁, wherein α₀ and α₁ are non-binary and unequal, wherein P₀ ^(new) and P₁ ^(new) are based on a comparison of what an old probability predicts a predicted value of a bit should be to what an actual value of the bit is, and wherein W₀ and W₁ are specified numbers of bits in a bin string; and code, using α₀, α₁, and multi-hypothesis context-adaptive binary arithmetic coding (MCABAC), a portion of a video.
 21. The method of claim 1, further comprising adaptively changing α₀ and α₁.
 22. The method of claim 1, further comprising: setting a first length M_(s) for W₀; and setting a second length M_(l) for W₁.
 23. The method of claim 1, further comprising setting α₀ and α₁ differently for each context model.
 24. The method of claim 1, further comprising setting α₀ and α₁ the same for each context model.
 25. The method of claim 1, further comprising setting α₀ and α₁ the same for all context models.
 26. The method of claim 1, further comprising further coding the portion using a context model specific to a syntax element to be coded. 